/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package views;

import controllers.Boletos;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Date;
import java.util.List;
import java.util.Random;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JLabel;
import models.Pelicula;
import models.enums.TipoPrecio;

/**
 *
 * @author kevin_000
 */
public class Ticket extends javax.swing.JFrame {
 static Integer total = 0;
    Boletos b;
    List<TipoPrecio> tipoPrecios;

    /**
     * Creates new form ComprarBoletos2
     */
    Pelicula p;
    Date d;
    ResultSet rs;
    Random r;
    public Ticket() {
        initComponents();
        setSize(500, 320);
        setLocationRelativeTo(null);
        b = new Boletos();
        List<Pelicula> boleto = b.getBoletoCompra();
        System.out.println(boleto);
    }

    Ticket(String pelicula, String funcion, String sala, String fecha, String hora) {
        initComponents();
        setSize(500, 320);
        setLocationRelativeTo(null);
        lblPelicula.setText(pelicula);
        lblFuncion.setText(funcion);
        lblSala.setText(sala);
        lblFecha.setText(fecha);
        lblHora.setText(hora);
        r = new Random();
        Integer random = r.nextInt(99999);
        lblNumBoleto.setText(random.toString());
        
    }

    
    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        lblFuncion = new javax.swing.JLabel();
        lblPelicula = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        lblNumBoleto = new javax.swing.JLabel();
        lblSalanombre = new javax.swing.JLabel();
        lblSala = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        jLabel15 = new javax.swing.JLabel();
        lblHora = new javax.swing.JLabel();
        jLabel18 = new javax.swing.JLabel();
        lblFecha = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        getContentPane().setLayout(null);

        lblFuncion.setFont(new java.awt.Font("Rockwell Condensed", 0, 18)); // NOI18N
        lblFuncion.setForeground(new java.awt.Color(255, 255, 255));
        lblFuncion.setText("12:01am");
        getContentPane().add(lblFuncion);
        lblFuncion.setBounds(110, 190, 50, 30);

        lblPelicula.setFont(new java.awt.Font("Rockwell Condensed", 1, 24)); // NOI18N
        lblPelicula.setForeground(new java.awt.Color(255, 255, 255));
        lblPelicula.setText("PeliculaNombre");
        getContentPane().add(lblPelicula);
        lblPelicula.setBounds(50, 150, 420, 50);

        jLabel7.setFont(new java.awt.Font("Rockwell Condensed", 0, 18)); // NOI18N
        jLabel7.setForeground(new java.awt.Color(255, 255, 255));
        jLabel7.setText("HORA:");
        getContentPane().add(jLabel7);
        jLabel7.setBounds(350, 30, 60, 30);

        lblNumBoleto.setFont(new java.awt.Font("Rockwell Condensed", 0, 18)); // NOI18N
        lblNumBoleto.setForeground(new java.awt.Color(255, 255, 255));
        lblNumBoleto.setText("numboleto");
        getContentPane().add(lblNumBoleto);
        lblNumBoleto.setBounds(350, 190, 90, 30);

        lblSalanombre.setFont(new java.awt.Font("Rockwell Condensed", 0, 18)); // NOI18N
        lblSalanombre.setForeground(new java.awt.Color(255, 255, 255));
        lblSalanombre.setText("Sala");
        getContentPane().add(lblSalanombre);
        lblSalanombre.setBounds(340, 90, 40, 30);

        lblSala.setFont(new java.awt.Font("Rockwell Condensed", 0, 18)); // NOI18N
        lblSala.setForeground(new java.awt.Color(255, 255, 255));
        lblSala.setText("num");
        getContentPane().add(lblSala);
        lblSala.setBounds(390, 90, 40, 30);

        jLabel9.setFont(new java.awt.Font("Rockwell Condensed", 0, 18)); // NOI18N
        jLabel9.setForeground(new java.awt.Color(255, 255, 255));
        jLabel9.setText("Numero de Boleto");
        getContentPane().add(jLabel9);
        jLabel9.setBounds(210, 190, 230, 30);

        jLabel11.setFont(new java.awt.Font("Rockwell Condensed", 0, 18)); // NOI18N
        jLabel11.setForeground(new java.awt.Color(255, 255, 255));
        jLabel11.setText("Sala");
        getContentPane().add(jLabel11);
        jLabel11.setBounds(20, 190, 90, 30);

        jLabel15.setFont(new java.awt.Font("Rockwell Condensed", 1, 36)); // NOI18N
        jLabel15.setForeground(new java.awt.Color(255, 255, 255));
        jLabel15.setText("Entrada");
        getContentPane().add(jLabel15);
        jLabel15.setBounds(60, 110, 160, 50);

        lblHora.setFont(new java.awt.Font("Rockwell Condensed", 0, 18)); // NOI18N
        lblHora.setForeground(new java.awt.Color(255, 255, 255));
        lblHora.setText("11:00pm");
        getContentPane().add(lblHora);
        lblHora.setBounds(400, 30, 90, 30);

        jLabel18.setFont(new java.awt.Font("Rockwell Condensed", 0, 18)); // NOI18N
        jLabel18.setForeground(new java.awt.Color(255, 255, 255));
        jLabel18.setText("FECHA:");
        getContentPane().add(jLabel18);
        jLabel18.setBounds(350, 10, 60, 30);

        lblFecha.setFont(new java.awt.Font("Rockwell Condensed", 0, 18)); // NOI18N
        lblFecha.setForeground(new java.awt.Color(255, 255, 255));
        lblFecha.setText("19/11/2014");
        getContentPane().add(lblFecha);
        lblFecha.setBounds(400, 10, 90, 30);

        jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/IMAGENES/Ticket.png"))); // NOI18N
        getContentPane().add(jLabel1);
        jLabel1.setBounds(0, 0, 500, 300);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(Ticket.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(Ticket.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(Ticket.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Ticket.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new Ticket().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JLabel lblFecha;
    private javax.swing.JLabel lblFuncion;
    private javax.swing.JLabel lblHora;
    private javax.swing.JLabel lblNumBoleto;
    private javax.swing.JLabel lblPelicula;
    private javax.swing.JLabel lblSala;
    private javax.swing.JLabel lblSalanombre;
    // End of variables declaration//GEN-END:variables


}
